<?php
/**
 * Created by PhpStorm.
 * User: white
 * Date: 2020/5/9
 * Time: 17:43
 */

namespace app\common\validate;


use think\Validate;

class Course extends Validate
{
    protected $rule = [
        'cname|课程名' => 'require|unique:course',
        'score|课程评分' => 'require|in:1,2,3,4,5',
        'account|课程简介' => 'require',
        'img|课程图片' => 'require|image',
        'details|课程详情' => 'require'
    ];

    //验证场景
    protected $scend = [
        'edit' => ['cname','score','account','details']
    ];
}